<template>
    <el-button>按钮</el-button>
    <el-date-picker
      v-model="value1"
      type="date"
      placeholder="选择日期"
    >
    </el-date-picker>
    <el-dropdown @command="changeLanguage">
      <el-button type="primary">
        切换语言<i class="el-icon-arrow-down el-icon--right" />
      </el-button>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item command="zhCn">
            中文
          </el-dropdown-item>
          <el-dropdown-item command="en">
            英文
          </el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </template>
  <script lang="ts">
  import { defineComponent } from 'vue'
  
  type localType = 'zhCn' | 'en'
  
  export default defineComponent({
    setup () {
      return {
        value1: ''
      }
    },
    methods: {
      /**
       * 切换语言
       * @param type
       */
      changeLanguage (type: localType): void {
        this.$emit('change', type)
      }
    }
  })
  </script>
  
